<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title><style>
        div{
            height: 2000px;
            width: 2000px;
        }
    </style>
</head>
<body>
    <div>

    </div>
    <button id="btn">回到顶部</button>
</body>
<script>
    let btn = document.querySelector('#btn')
  
   btn.onclick = function(){
    // scrollTo(0,0)
    
    // window.scrollTo({
    //     left:0,
    //     top:500,
    // })

   }
   console.log(screenX,screenY)
</script>
</html>